<h3 style="padding:5px">Choose your new avatar</h3>

<?php if (!count($this->collections)):?>
<?php echo $this->translate('No collections were found.') ?>
<?php else: ?>

<table style="margin:5px; min-width:600px">
  <tr>
    <td valign="top">


    <?php foreach ($this->collections as $collection): ?>
    <?php if (trim($collection->description)) echo "<span class='avatarcollection' >" ?>
    <a id="collection_<?php echo $collection->avatarcollection_id ?>" href="<?php echo $this->url(array('module'=>'avatar','controller'=>'edit','action'=>'getavatarcollection', 'collection_id' => $collection->avatarcollection_id), 'default') ?>" ><?php echo $collection->name ?>(<?php echo $collection->count_avatars ?>)</a>
    <?php if (trim($collection->description)) echo "</span>" ?>

   
    
    <?php endforeach;?>
    <div class='clear'></div>

	</td>
	<td valign="top">
<div style="float: left;margin-left: 10px;">
    <h2 style="font-size:14px; margin-bottom:0px"><?php echo $this->current_collection->name ?>(<?php echo $this->current_collection->count_avatars ?>)</h2>
    <p><?php echo $this->current_collection->description ?></p>
	<br />
    <?php if ($this->current_collection->count_avatars == 0):?>
    <p><?php echo $this->translate('Avatars not found.') ?></p>
    <?php else :?>
    <?php foreach ($this->avatars as $avatar) :?>
    <div class="avatar_box">
        
        <span><?php echo $this->htmlLink(array('route' => 'default', 'module' => 'avatar', 'controller' => 'edit', 'action' => 'select', 'avatar_id' => $avatar->avatar_id), 
                                   $this->translate(''),
								   array(
								   'class' => 'webcam_button_link2',
								   'style' => 'background-image: url(application/modules/Avatar/externals/images/select.png); width:16px; height:16px; display:block')) ?></span>

								   
								   
		<a href="<?php echo $this->url(array('module' => 'avatar', 'controller' => 'edit', 'action' => 'select', 'avatar_id' => $avatar->avatar_id), 'default', true)?>"><img src="<?php echo $this->baseUrl() . '/application/modules/Avatar/externals/avatarcollections/' . $avatar->avatarcollection_id . '/' . 'avatar_' . $avatar->avatar_id . '.' . $avatar->extension ?>" alt="Avatar"/></a>
    </div>
    <?php endforeach; ?>
    <?php endif; ?>
    <div style="clear:both;"></div>
</div>	
	</td>
  </tr>
</table>

<div style="margin:5px"><button onclick="parent.Smoothbox.close();" type="button" id="cancel" name="cancel">Close</button></div>

<?php endif; ?>
